package com.naiterui.ehp.bs.b2c.inventory.repository;

import java.util.List;
import java.util.Set;

import org.springframework.stereotype.Repository;

import com.naiterui.common.repository.core.BaseJpaRepository;
import com.naiterui.ehp.bs.b2c.inventory.entity.Inventory;

/**
 * 库存持久化仓库
 */
@Repository
public interface IStockRepository extends BaseJpaRepository<Inventory, Long> {

    void removeAllByWarehouseIdAndSkuIdIn(Long warehouseId, Set<Long> skuIds);

    List<Inventory> findByWarehouseId(Long warehouseId);

    List<Inventory> findBySkuIdInAndStatus(Set<Long> skuIds, Integer status);

    List<Inventory> findByWarehouseIdAndSkuIdIn(Long warehouseId, Set<Long> skuIds);

    List<Inventory> findByWarehouseIdAndSkuIdInAndStatus(Long warehouseId, Set<Long> skuIds, Integer status);

}
